]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
loginDialog: move user list loading after actors are constructed
authorRay Strode <rstrode@redhat.com>
Fri, 10 Jan 2014 14:27:46 +0000 (09:27 -0500)
committerRay Strode <rstrode@redhat.com>
Mon, 13 Jan 2014 17:42:39 +0000 (12:42 -0500)
Right now we queue populating the user list in the middle of setting
up the dialog actors. Of course, the actual population happens some time
later after going back to the main loop.

It's more logical to structure the code so the the actors are
instantiated first in one block and then other things after that.

This commit moves the user list population enqueuing operation to the
bottom of the constuctor.

https://bugzilla.gnome.org/show_bug.cgi?id=721868

js/gdm/loginDialog.js

index 49ca5ea5aaff341f01a1814664ccf4ba893692b7..7810b03e481001034ce9c5b29cf72b3a7333bda5 100644 (file)
@@ -454,18 +454,6 @@ const LoginDialog = new Lang.Class({
         this.actor.add_child(this._logoBin);
         this._updateLogo();
 
-        if (!this._userManager.is_loaded)
-            this._userManagerLoadedId = this._userManager.connect('notify::is-loaded',
-                                                                  Lang.bind(this, function() {
-                                                                      if (this._userManager.is_loaded) {
-                                                                          this._loadUserList();
-                                                                          this._userManager.disconnect(this._userManagerLoadedId);
-                                                                          this._userManagerLoadedId = 0;
-                                                                      }
-                                                                  }));
-        else
-            GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, this._loadUserList));
-
         this._userList.connect('activate',
                                Lang.bind(this, function(userList, item) {
                                    this._onUserListActivated(item);
@@ -481,6 +469,18 @@ const LoginDialog = new Lang.Class({
         this._sessionMenuButton.actor.show();
         this._authPrompt.addActorToDefaultButtonWell(this._sessionMenuButton.actor);
 
+        if (!this._userManager.is_loaded)
+            this._userManagerLoadedId = this._userManager.connect('notify::is-loaded',
+                                                                  Lang.bind(this, function() {
+                                                                      if (this._userManager.is_loaded) {
+                                                                          this._loadUserList();
+                                                                          this._userManager.disconnect(this._userManagerLoadedId);
+                                                                          this._userManagerLoadedId = 0;
+                                                                      }
+                                                                  }));
+        else
+            GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, this._loadUserList));
+
    },
 
     _updateDisableUserList: function() {